<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>车辆资产信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
	<form id="cust_cst_ass_info_car_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">设备名称</div>
                    <div class="field">
                        
                        <span id="assNm" name="assNm"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">品牌</div>
                    <div class="field">
                        
                        <span id="brCd" name="brCd"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">型号</div>
                    <div class="field">
                        <span id="prdMdl" name="prdMdl"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">所有权人</div>
                    <div class="field">
                       <span id="assOwner" name="assOwner"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">市值(元)</div>
                    <div class="field">
                        <span id="value" name="value"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">数量</div>
                    <div class="field" style="width: 100%;">
                    	<span id="qty" name="qty"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">收益(元)</div>
                    <div class="field" style="width: 100%;">
                    	<span id="revenue" name="revenue"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">购买时间</div>
                    <div class="field" style="width: 100%;">
                    	<span id="purchDt" name="purchDt"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">备注</div>
                    <div class="field" style="width: 100%;">
                    	<span id="assRem" name="assRem"></span>
                    </div>
                </div>
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name="caiId" id="caiId" type="text" class="ui-textbox" value="${caiId}">
		          </div>
		        </div>
            </div>
            <div class="btnsBox">
                <span id="cust_cst_ass_info_car_form_cancel_btn_id" class="sq-button sq-button-round">取消</span>
            </div>
        </form>
        <script>
		$(function() {
		   $("#cust_cst_ass_info_car_form").ligerForm({
                validate: true
           });
		
	        //取消
	        $("#cust_cst_ass_info_car_form_cancel_btn_id").click(function(event) {
	        	frameElement.dialog.close();
	        });
	        
	        initData();
		});
		
		function initData(){
			var caiId = $("#caiId").val();
	    	if(!caiId)return;
	    	var wait_dialog= top.$.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });
	    	var _url = '<%=path%>/customer/cstassinfo/getCarById.do';
	    	
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:caiId},
	    		url: _url,
	    		success:function(msg){
	    			wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			 }
	    		}
	    	});
    	}
		
		//设置页面数据
	     function setData(data){
	    	$("#brCd").html(data.brCd);
	    	$("#assNm").html(data.assNm);
	    	$("#prdMdl").html(data.prdMdl);
	    	$("#assOwner").html(data.assOwner);
	    	$("#value").html(data.value);
	    	$("#qty").html(data.qty);
	    	$("#revenue").html(data.revenue);
	    	var date = new Date(data.purchDt);
	    	var dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
	    	$("#purchDt").html(dateStr);
	    	$("#assRem").html(data.assRem);
		}; 
	</script>
</body>
</html>